<?php
set_time_limit ( 0 );
include_once '../connect.php';

$sql = "SELECT id,url,shoujia FROM fangjia where id >= 41861";
$result = mysql_query ( $sql, $dbc ) or die ( mysql_error () );


$Reg_Shoujia = "/<big>(.*)<\/big>元\/平米/Us";
while ( $arr_xiaoqu = mysql_fetch_array ( $result ) ) {
	if($arr_xiaoqu[shoujia] == ''){
		continue;
	}
	$fcontents = file_get_contents ( $arr_xiaoqu[url] );
	

	
	preg_match_all ( $Reg_Shoujia, $fcontents, $Arr_Shoujia );//
	$shoujia = $Arr_Shoujia[1][0];
	

	
	$query = "UPDATE fangjia SET shoujia = '$shoujia' WHERE id = '$arr_xiaoqu[id]'" ;

	$result_xiaoqu = mysql_query ( $query, $dbc ) or die ( mysql_error () );
	echo $arr_xiaoqu[id]."<br>";
	
}
echo "售价写完了";
?>